#pragma once

// CHorizontalScrollbar

class CHorizontalScrollbar : public CStatic
{
	DECLARE_DYNAMIC(CHorizontalScrollbar)

public:
	CListCtrl*		m_pList;

private:
	BOOL			m_bMouseDownArrowRight;
	BOOL			m_bMouseDownArrowLeft;
	BOOL			m_bDragging;
	BOOL			m_bMouseDown;

	int				m_nThumbLeft;
	double			m_dbThumbInterval;
	double			m_dbThumbRemainder;

public:
	CHorizontalScrollbar();
	virtual ~CHorizontalScrollbar();

	void LimitThumbPosition();
	void Draw();
	void PageLeft();
	void PageRight();
	void UpdateThumbPosition();

	void ScrollLeft();
	void ScrollRight();
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);

protected:
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnTimer(UINT nIDEvent);
	DECLARE_MESSAGE_MAP()
};


